<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            background-color: pink;
            margin: 200px;
        }
    </style>
</head>
s

<body>
    <div class="box"></div>

</body>


<script>
    let box = document.querySelector('.box');
    box.addEventListener('mousemove', function(e) {
        // console.log(e.pageX - this.offsetLeft);
        // console.log(e.pageY - this.offsetTop);
        box.innerHTML = '(' + (e.pageX - this.offsetLeft) + ',' + (e.pageY - this.offsetTop) + ')';
    })
</script>

</html>